#include "StdAfx.h"
#include "str.h"



const wchar_t* str::a2w( const char*str )
{
	int len = (int)strlen(str) + 1;
	static wchar_t buf[512];
	MultiByteToWideChar(CP_ACP, 0, str, -1, buf, _countof(buf));
	return buf;
}

SplitString::SplitString( const TCHAR*str,const TCHAR*sp )
{
	TCHAR*cc;
	int len=_tcslen(str);
	TCHAR*buf=new TCHAR[len+1];
	_tcscpy(buf,str);
	TCHAR*s=_tcstok_s(buf,sp,&cc);
	while(s)
	{
		m_arrStr.push_back(s);
		s=_tcstok_s(NULL,sp,&cc);
	}
	delete[] buf;
}
